package com.sakura.protorype;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.TimeInterval;

/**
 * @Author Sakura
 * @Date 2022/11/14 16:19
 * @Version 1.0
 */
public class Client {
    public static void main(String[] args) {
        //TODO 举例展示传统方式，clone对象的问题
        Sheep sean = new Sheep("sean", 10, "white");

        TimeInterval timer = DateUtil.timer();
        for (int i = 0; i < 10000000; i++) {
            //TODO 频繁new 对象; 且无法动态获取原型最新信息
            Sheep sheep = new Sheep(sean.getName(), sean.getAge(), sean.getColor());
        }

        System.out.println("耗时(ms):" + timer.interval());
    }
}
